home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / WIN / VB_DB / DBTBL1.ZIP / TBL.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-03-06  |  14.3 KB  |  317 lines

  1. DemoForm
  2. (DBT Grid Data Aware via DBEngine 3.0 VBX
  3. Form1
  4. DBTGrid1
  5. DBTGrid
  6. $(Copyright (C)-1993, by Douglas A. Bebber&
  7.      CMDialog1
  8. CommonDialog
  9. PXTable
  10. DBENGINE
  11. *$Copyright (C)-1993,Douglas A. Bebber+
  12. MNU_Tbl
  13. &Table
  14. MNU_TblOpen
  15. &Open
  16. MNU_TblClose
  17. &Close
  18. MNU_GridFont
  19. &Font
  20. MNU_Exit
  21. E&xit
  22. MNU_TblOpen_Click
  23. Status
  24.     CMDialog1+
  25. DefaultExt
  26. DialogTitle
  27. Filter
  28. FilterIndexU
  29. Flags
  30. OFN_HIDEREADONLYK
  31. OFN_FILEMUSTEXIST
  32. CancelError
  33. Action
  34. PXTable
  35.     TableNameD
  36. Filename
  37. Passwordq
  38. PasswordstrF
  39. AddPassword
  40. Reaction
  41. EncryptTable
  42. DB_OpenTable
  43. MNU_TblClose_ClickZ
  44. DB_CloseTable
  45. Form_Click<
  46. SetupTable
  47. DB_NFields
  48. DBTGrid1m
  49. Columns
  50. NFields
  51. DB_NRecords
  52. NRecords
  53.     DataModel
  54.     SetupGrid
  55. Visible
  56. FieldNumber8
  57. DB_GetFieldName
  58. ColumnLabels
  59. ColumnHeading
  60.     FieldName(
  61. Column
  62. DBTGrid1_AbortEdit
  63. Form_Resize
  64. DemoForm
  65. Heightu
  66. MNU_Exit_Click
  67. Width`
  68. FillGrid
  69. DB_GetRecordI
  70. DB_FirstRecordn
  71. DB_GetField
  72. Texti
  73. FieldValue
  74. DB_NextRecord
  75. DBTGrid1_BeginEdit
  76. DB_LockRecord
  77.     AbortEdit
  78. TopVisibleRow
  79. LeftVisibleColumn
  80. DB_UnlockRecord    
  81. DBTGrid1_CellValueChanged
  82. DB_PutField+
  83. DB_UpdateRecordK
  84. DBTGrid1_GridPositionChanged~
  85. DBTGrid1_CellDoubleClicked 
  86. DBTGrid1_CellFull
  87. DBTGrid1_ColumnAdded
  88. DBTGrid1_ColumnDeleted
  89. DBTGrid1_ColumnMoved
  90. DBTGrid1_ColumnSized
  91. DBTGrid1_GotFocus
  92. DBTGrid1_GridClick    
  93. GridClickPositionU
  94. DBTGrid1_GridHScrollm
  95. DBTGrid1_GridSelectChange
  96. DBTGrid1_GridVScroll
  97. DBTGrid1_KeyStroke
  98. KeyAscii
  99. DBTGrid1_LostFocus
  100. DBTGrid1_MemoryError(
  101. DBTGrid1_Resize
  102. PreviousRow
  103. DB_PreviousRecord
  104.     TheCursor^
  105.     SetCursor
  106. LoadCursor
  107. IDC_WAIT5
  108.     EventMask
  109. CurrentColumnm
  110. CurrentRow
  111. Redraw
  112. ErrorStatus
  113. MNU_GridFont_Click
  114. CF_SCREENFONTS
  115. CF_EFFECTS
  116. FontSize
  117. FontName
  118. FontBold
  119. FontItalic
  120. FontUnderline
  121. FontStrikethru
  122. Color
  123.     ForeColor@
  124. Caption
  125. DBEngineErrorMessage
  126.     ErrorCode`
  127. Used when we set the hourglass cursor while filling the grid.n
  128. MNU_TblOpen_Click
  129. Perform a CloseTable even if no table is currently open.
  130. Just to make sure we have no open database tables.
  131. Open Paradox Table
  132. Paradox Table (*.DB)| *.DB
  133. Set default filter
  134. Set dialog options
  135. Hide read only box
  136. Display the dialog
  137. User chose the OK button..
  138. MsgBox "Table selected: " + CMDialog1.FileName
  139. Move to the first field in the first database record.-
  140. MsgBox "Cancel was selected!"i
  141. MNU_TblClose_Click
  142. Error closing table.
  143. Form_Resize
  144. MNU_Exit_Click
  145. Close the database table just in case it is not already closed..
  146. Don't care about error..
  147. DBTGrid1_BeginEdit
  148. Can not read record!
  149. Can not lock record!
  150. DBTGrid1_CellValueChanged
  151. Error writing field!
  152. Cannot update record!"
  153. Cannot unlock record!"
  154. FillGrid
  155. We will fill the DBT Grid with records from the PARADOX 
  156. database table here.
  157. Place the current cursor in our TheCursor variable and
  158. show the old hourglass.r
  159. Disable or mask the GridPositionChanged event here
  160. while we move in the grid to fill info.i
  161. Move to the first database record.
  162. Return error (if any)r
  163. Database Record Loop.
  164. Read the current database record..
  165. Return error (if any)e
  166. Database field loop.
  167. Read the field.e
  168. Return error (if any).
  169. Place the FieldValue in the grid cell.
  170. Field loop.l
  171. Move to next database record.h
  172. Record loop.
  173. Enable the GridPositionChanged event.d
  174. SetupGrid
  175. This function will dimension the DBT Grid to fit the database table
  176. record structure (one grid cell for every database field). In this
  177. function we only create as many grid cells as there are fields in the
  178. database table.y
  179. We then label the DBT Grid columns with the field names stored in the
  180. Paradox database table.r
  181. Note that this simple demo processes Paradox database tables in batch mode.a
  182. We fill the entire database table into the grid. For large database tables
  183. this method may prove unacceptable for performance reasons. In that case
  184. you will want to buffer the database table through the DBT Grid. A sample
  185. demo program illustrating the mechanics of this buffering implementation
  186. will be coming soon.
  187. To accomodate multi-user environments we have provided code (found in the
  188. DBT Grid's GridPositionChanged event routine) that refreshes the grid based
  189. table image when the number of records in the database varies from the
  190. number of rows in the grid. 
  191. This demo's updating of database records will 
  192. work in multi-user environments. No references to absolute record numberse
  193. are present in the code. Record locks must be successfully obtained before
  194. grid cell editing is allowed. When grid cell edits are completei
  195. (EndEdit event routine) the appropriate record is updated and unlocked.o
  196. In the case of an (AbortEdit event) the record is not updated and unlocked.
  197. Get the number of fields in the database table.e
  198. Return an error (if any). 
  199. Dimension the DBT Grid based on the table field count.
  200. Return an error (if any).d
  201. Get the number of records in the databasea
  202. Return an error (if any).e
  203. Large data set
  204. Dimension the DBT Grid rowse
  205. based on table record count.
  206. Can not allocate enough grid rows!
  207. Now label the Grid Fields with the field names found in the database..
  208. User defined.d
  209. Return an error (if any).m
  210. DBTGrid1_AbortEdit
  211. Can not unlock record!
  212. DBTGrid1_GridPositionChanged
  213. The user has moved within the grid!
  214. We need to make sure that we are positioned on
  215. the correct record in the database!s
  216. But first see if we need to refresh the grid.n
  217. Move back in the databaseh
  218. Move ahead in the database
  219. MNU_GridFont_Click
  220. This is a crude routine which allows the user to change-
  221. the grid fonts only screen fonts are allowed. 
  222. DBEngineErrorMessage
  223. This subroutine accepts a DBEngine error code (passed to the
  224. subroutine most likely from the DBEngine.Reaction property).
  225. The subroutine then just displays a message box reporting the
  226. exact error to the user.
  227. Drive not ready.
  228. Directory not found.
  229. File is busy."
  230. File is locked."
  231. File not found."
  232. Table is damaged."
  233. Primary index is damaged."
  234. Primary index is out of date."
  235. Record is locked."
  236. Sharing violation - directory is busy.
  237. Sharing violation - directory is locked.
  238. No access to directory."
  239. Sort for index differs from that of table.
  240. Single user but directory is shared.
  241. Multiple PARADOX.NET files found."
  242. Insufficient password rights."
  243. Table is write-protected."
  244. Data type mismatch."
  245. Argument out of range.
  246. Invalid argument."
  247. Not enough memory to complete the operation.
  248. Not enough disk space to complete the operation.
  249. Another user deleted the record.
  250. BLOB open mode, action N/A."
  251. BLOB already open.
  252. Invalid BLOB offset.
  253. Invalid BLOB size.
  254. Other user modified BLOB."
  255. Bad BLOB file.
  256. Can not index on BLOB.
  257. Bad BLOB handle.
  258. Can not search on BLOB."
  259. No more file handles available."
  260. No more table handles available.
  261. Invalid date."
  262. Invalid field name."
  263. Invalid field handle."
  264. Invalid table handle."
  265. Engine not initialized."
  266. Previous fatal error, cannot continue.
  267. Table structures are different."
  268. Engine already initialized."
  269. Unable to perform operation on an open table."
  270. No more temporary names available.
  271. Record not found."
  272. Table is indexed."
  273. Table is not indexed."
  274. Secondary index is out of date."
  275. Key violation.
  276. Could not login on network."
  277. Invalid table name."
  278. End of table."
  279. Start of table."
  280. No more record handles available."
  281. Invalid record handle.
  282. Operation on an empty table.
  283. Invalid lock code.
  284. Engine not initialized."
  285. Invalid file name.
  286. Invalid lock."
  287. Invalid lock handle.
  288. Too many locks on table.
  289. Invalid sort-order table."
  290. Invalid net type."
  291. Invalid directory name."
  292. Too many passwords submitted."
  293. Invalid password."
  294. Buffer too small for the result.
  295. Table is busy.
  296. Table is locked.
  297. Table was not found.
  298. Secondary index was not found.
  299. Secondary index is damaged."
  300. Secondary index is already open.
  301. Disk is write-protected.
  302. Record is too big for index.
  303. General hardware error."
  304. Not enough stack space to complete the operation."
  305. Table is full.
  306. Not enough swap buffer space to complete the operation."
  307. Table is SQL replica."
  308. Too many clients for the Engine DLL.
  309. Exceeds limits specified in WIN.INI file."
  310. Too many files open simultaneously (includes all clients).
  311. Can't lock PARADOX.NET, is SHARE.EXE loaded?
  312. Can't run the Engine in Windows REAL mode.
  313. Can't modify unkeyed table with a non-maintained secondary index."
  314. Timed out performing lock operation.
  315. Unknown error.
  316. Database Error
  317.